package {
	import flash.events.Event;
	import flash.events.EventDispatcher;
	
	public class Model extends EventDispatcher {
		private static var instance:Model;
		private static var allowInstantiation:Boolean;
		
		public static function getInstance():Model {
			if (instance == null) {
				allowInstantiation = true;
				instance = new Model();
				allowInstantiation = false;
			}
			return instance;
		}
		
		public function Model():void {
			if (!allowInstantiation) {
				throw new Error("Error: Instantiation failed: Use SingletonDemo.getInstance() instead of new.");
			}
		}
		
		/////////////////////////////////////////////////
		
		// end enforcer
		
		/////////////////////////////////////////////////
		
		
		private var _keywordsArray:Array = [
			{word:"American History", linkedTo:"Collection"}, 
			{word:"Antiques", linkedTo:"Collection"}, 
			{word:"Archaeology", linkedTo:"Collection"}, 
			{word:"Museums", linkedTo:"Asset"},
			{word:"Wisconsin", linkedTo:"Asset"}
		];
		
		public function set keywordsArray (val:Array):void {
			_keywordsArray = val;
			dispatchEvent(new Event("KeywordArrayUpdate"));
		}
		public function get keywordsArray ():Array {
			return _keywordsArray;
		}
		
		
		
		
		
		
		
	}
}